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KRLv
KOSJVXXpwLh1K2xbXaEoUsf6iiLkFduEIsn8t75wxHYOR3tKrYVpy++IwJnt/L/2
60cTWmunIkx2SCFHyrJ2JCTjGetc1+7XkgPVOCcCggEBAJ4D6wdKT+2VnM+CN5Mc
nnMhnTOHGE5RKbzza3ALSeMccbeNn/HzfE06YMe5vlMkW6rJRWH+V7F3m60cAu0z
08+PEJ3rVHwQh0m5rVKMfv8JmNnqMs6UyYiogooCzUMSgKPo11tqAZqWfBaemwdi
3+fvI8zt5DEq8wPIcmrsAuqPKrogx6mSXMA6xHZFfdqTtuBdp95GmEa5wk0CXQeY
pSNU3NVltoACut346CLpyd1Zu17RomZE9kHDoc4vF371lQzYcTnBkZ/zwjcAsNZn
lwR2IHcH08RYe0w+5O8dOXTMB25eob2VyE5Q6DasOhoMTJL6nD+gMbvTohKkQ3ub
OEECggEAX32vRtHEfnleOJ0lXTqDzxdzaca37y8fZARFUmXuoSiEHph+kXEWAWhP
rsNDeMVW4S9piPvGYc4jM2J88bdKl4da/N5pRUMVStUALafPYuknLZcrWJ9XrF74
6OacnVFIgvqvBqB81UstDbCrCO59jG6rAMVgKOfOoY4kQhmObc+3MY0s+CJmTgGt
ToZBp52d8r6k7wyuEDn/PBcFfKcOO7ImUnsbKvCL9x5gNVqVYhyC9VlpU5U9e6ac
zDXXd8qevzG3h5dVOzRwwgtyS4PzJSXaerwbOZrTYGCeYbXV0Pww7asanB90tOdy
A9Ya9Lj4oXsTJ76in3JK2QoqtL2Jbw==`;

export function encrypt(plainText: string): string {
  const jsEncrypt = new JSEncrypt();

  jsEncrypt.setPublicKey(pub_key);
  jsEncrypt.setPrivateKey(pri_key);
  return <string>jsEncrypt.encrypt(plainText);
}
